package kt_test.room.dao

import androidx.room.*
import kt_test.room.entity.UserInfoEntity

@Dao
interface UserInfoDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(user: UserInfoEntity)  // 原来的

    @Query("SELECT * FROM user_info WHERE userId = :id LIMIT 1")
    suspend fun getById(id: String): UserInfoEntity?

    // 供 Java 使用的插入方法
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertDirect(user: UserInfoEntity)
}
